<?php
/*
**
* Written By : MaaSTaaR
* Version    : 1.1
* Describe   : Processing $_GET , $_POST and $_COOKIE arrays
**
*/

class SmartParam
{
	/*
 	**
 	* param :
 	* Processing $_GET , $_POST , $_COOKIE
 	*
 	* @access public
 	* @return string
 	**
 	*/
 	function param()
    {
  		# Processing $_GET
  		if (!empty($_GET))
        {
   			foreach ($_GET as $varname=>$value)
            {
    			if (get_magic_quotes_gpc())
                {
     				$_GET[$varname] = $value;
    			}
    			else
                {
     				$_GET[$varname] = addslashes($value);
    			}
   			}
  		}

  		# Processing $_POST
  		if (!empty($_POST))
        {
   			foreach ($_POST as $varname=>$value)
            {
    			if (get_magic_quotes_gpc())
                {
     				$_POST[$varname] = $value;
    			}
    			else
                {
     				$_POST[$varname] = addslashes($value);
    			}
   			}
  		}

  		# Processing $_COOKIE
  		if (!empty($_COOKIE))
        {
   			foreach ($_COOKIE as $varname=>$value)
            {
    			if (get_magic_quotes_gpc())
                {
     				$_COOKIE[$varname] = $value;
    			}
    			else
                {
     				$_COOKIE[$varname] = addslashes($value);
    			}
   			}
  		}
 	}
}

?>